'use strict';
/**
 * Created by FreezeSoul on 2015/9/25.
 */
define([
        'angular',
        'app/modules/player/define'
    ],
    function(angular) {
        angular.module('ad.player')
            .directive('adPlayerHeaderDirective',['$rootScope','$state',function($rootScope,$state){
                return {
                    templateUrl:'app/modules/player/views/header.tpl.html',
                    restrict: 'E',
                    replace: true,
                    link:function($scope, $element,$attrs){
                        $scope.exitToLogin = function(){
                            $rootScope.currentUser = null;
                            $state.go('login');
                            return false;
                        };
                        $scope.goToSetting = function(){
                            $state.go('editor.home');
                            return false;
                        };

                    }
                }
            }]);
    });
